#include "../source/server.hpp"

using namespace wyl;

int main()
{
  Socket cli;
  cli.CreateClient(8081,"47.113.218.27");
  std::string req = "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 100\r\n\r\nhahahahah";
  while(1)
  {
    assert(cli.Send(req.c_str(),req.size())!= -1);
    assert(cli.Send(req.c_str(),req.size())!= -1);
    assert(cli.Send(req.c_str(),req.size())!= -1);
    assert(cli.Send(req.c_str(),req.size())!= -1);
    assert(cli.Send(req.c_str(),req.size())!= -1);
    char buf[1024] = {0};
    assert(cli.Recv(buf,1023));
    DLOG("[%s]",buf);
    sleep(25);
  }
  cli.Close();
  return 0;
}
